<!--
 * @Author: Mary
 * @Date: 2023-04-19 09:01:42
-->
<template>
  <div :ref="info._id" v-ui-ref="vSetRef">
    <van-popup
      v-model:show="showModule"
      :style="{ padding: '10px', ...getWH, overflow: 'auto' }"
      :position="info.extension.position.value"
      closeable
      :overlay="false"
      teleport=".layer-page"
    >
      <p v-if="!contentList.length">暂无识别结果!请重试</p>
      <div v-for="(item, i) in contentList" :key="i">
        {{ item }}
      </div>
    </van-popup>
  </div>
</template>
<script>
  import { defineComponent } from 'vue'
  import { UiMixin, RefsInjectMixin } from '@ve/mixin'
  import { Popup } from 'vant'
  export default defineComponent({
    name: 'UiPdaIdentifyBox',
    components: {
      [Popup.name]: Popup,
    },
    mixins: [UiMixin, RefsInjectMixin],

    data() {
      return {
        showModule: false,
        contentList: [],
      }
    },
    computed: {
      getWH() {
        if (this.info.extension.position.value === 'top' || this.info.extension.position.value === 'bottom') {
          return { height: this.info.extension.size.value }
        } else {
          return { width: this.info.extension.size.value, height: '100vh' }
        }
      },
    },
    created() {},
    methods: {
      showPopup(data) {
        this.showModule = true
        this.contentList = data
      },
    },
  })
</script>
